@extends('seller::layout.master')

@section('title', __('seller::user.password_title'))

@section('content')
  <div id="shipping-app" class="card h-min-600">
    <div class="card-header">{{ __('seller::user.password_title') }}</div>
    <div class="card-body">
      <form class="needs-validation" novalidate action="{{ seller_route('edit.save_password') }}"
        method="POST">
        @csrf
        @method('POST')

        @if (session()->has('errors'))
          @foreach ($errors->all() as $error)
            <x-seller-alert type="danger" msg="{{ $error }}" class="mt-4"/>
          @endforeach
        @endif

        @if (session('error'))
          <x-seller-alert type="danger" msg="{{ session('error') }}" class="mt-4"/>
        @endif

        @if (session('success'))
          <x-seller-alert type="success" msg="{{ session('success') }}" class="mt-4"/>
        @endif

        <x-seller-form-input :error="$errors->first('password')" required name="password" :title="__('seller::edit.old_password')" :value="old('password', '')" />
        <x-seller-form-input :error="$errors->first('new_password')" required name="new_password" :title="__('seller::edit.new_password')" :value="old('new_password', '')" />
        <x-seller-form-input :error="$errors->first('new_password_confirmation')" required name="new_password_confirmation"  :title="__('seller::edit.confirm_new_password')" :value="old('new_password_confirmation', '')" />

        <x-seller::form.row>
          <button type="submit" class="btn btn-primary btn-lg mt-3">{{ __('common.save') }}</button>
        </x-seller::form.row>
      </form>
    </div>
  </div>
@endsection

@push('footer')

@endpush
